/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Howework.demo04;

/**
 *
 * @author 陈健铭
 */
public class Email {
    private static boolean flag;
    public static void main(String[] args) {
        String mobile="334035474@qq.com";
        if(!(mobile.startsWith("@")||mobile.startsWith("."))){
            flag=false;
        }
            String numstr="0123456789,@,.,";
            for(int i=0;i<mobile.length();i++){
            char c=mobile.charAt(i);
            int temp=numstr.indexOf(c);
            if(temp<0){
                flag=false;
                break;
                }
            }



             if(flag){
                System.out.println("合法的邮件地址");
        } else{
                System.out.println("不是合法的邮件地址");
            }  
    }
}
            
            

        
    


